<?php

use Illuminate\Database\Capsule\Manager as DB;

class LoginController extends AbstractController
{

    // 默认Action
    public function indexAction()
    {
        if($this->getRequest()->getPost('username')){
            if( $this->getRequest()->getPost('username') == "answeradmin" && $this->getRequest()->getPost('password') == "answer2017" ){

                $session=Yaf_Session::getInstance();
                $session -> islogin = 1 ;
                success("登陆成功","Admin/Index/index");
            } else {
                error("帐号密码不正确");
            }
        }
        $this->getView()->display("login/login.html");
    }

}
